package com.exam.bean;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 
 * @author MuLing
 * 
 */
@Embeddable
@Entity
@Table(name = "tb_paper_QType_Info")
public class PaperQTypeInfo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	// 指定为主键
	@GeneratedValue(strategy = GenerationType.AUTO)
	// 主键类型为自增长
	private Integer id;// 主键id

	@ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.EAGER)
	@JoinColumn(name = "p_id", referencedColumnName = "id")
	private Paper paper;// 对应试卷

	@ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.EAGER)
	@JoinColumn(name = "qt_id", referencedColumnName = "id")
	private QuestionType qType;// 题目类型

	@Column(name = "pi_count")
	private Integer count;// 对应类型题目多少个

	@Column(name = "pi_score")
	private Integer score;// 该类型题目设置的分值,可能出现

	/**
	 * @param count
	 *            the count to set
	 */
	public void setCount(Integer count) {
		this.count = count;
	}

	/**
	 * @return the count
	 */
	public Integer getCount() {
		return count;
	}

	/**
	 * @param score
	 *            the score to set
	 */
	public void setScore(Integer score) {
		this.score = score;
	}

	/**
	 * @return the score
	 */
	public Integer getScore() {
		return score;
	}

	/**
	 * @param paper
	 *            the paper to set
	 */
	public void setPaper(Paper paper) {
		this.paper = paper;
	}

	/**
	 * @return the paper
	 */
	public Paper getPaper() {
		return paper;
	}

	/**
	 * @param qType
	 *            the qType to set
	 */
	public void setqType(QuestionType qType) {
		this.qType = qType;
	}

	/**
	 * @return the qType
	 */
	public QuestionType getqType() {
		return qType;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

}
